<template>
    <div class="table">
        <div class="divSearch">
            <!--搜索框-->
            <Row>
                <Col :lg="{span:5}" :md="{span:8}" :sm="{span:16}" :xs="{span:22}">
                <label class="searchLabel">填报年度:</label>
                <Select v-model="searchModel.FillInYear" placeholder="全部" :label-in-value="true" @on-change="GetData()" class="searchInput">
                    <Option :value="item.DictText" v-for="item in CreateYearList" :key="item.DictValue">{{item.DictText}}</Option>
                </Select>
                </Col>
                <Col :lg="{span:2}" :md="{span:2}" :sm="{span:2}" :xs="{span:2}" v-show="isFull">
                <Button icon="ios-search" type="primary" @click="GetData()" class="searchButton">查询</Button>
                </Col>
                <Col :lg="{span:2}" :md="{span:2}" :sm="{span:2}" :xs="{span:2}" style="float:right">
                    <Button v-show="DataModel.ReportStatus>1" icon="ios-download" type="primary" @click="ExcelDown()" class="searchButton">数据导出</Button>
                </Col> 
                <Col :lg="{span:2}" :md="{span:2}" :sm="{span:2}" :xs="{span:2}" style="float:right" v-show="DataModel.ReportStatus<3&&isFull">
                    <Upload :on-success="handleSuccess" :action="GetPostUrl()" >
                        <Button type="primary" icon="ios-cloud-upload-outline" class="searchButton">数据导入</Button>
                    </Upload>
                </Col>
                <Col :lg="{span:2}" :md="{span:2}" :sm="{span:2}" :xs="{span:2}"  style="float:right">
                    <Button icon="ios-cloud-download" type="primary" @click="TmpDown()" class="searchButton">模板下载</Button>
                </Col>
            </Row>
        </div>
        <Row>
            <Col>
                <div v-if="isFull">
                    <Form ref="DataModel" :model="DataModel" :rules="ruleModel">
                        <table class="reportTable">
                            <caption>
                                <label style="float:left">(八){{searchModel.FillInYear}}蔬菜生产经营实体及相关情况(全面统计)</label>
                                <label style="float:right">当前状态:
                                    <span v-if="DataModel.ReportStatus==0" class="Error">退回重报</span> 
                                    <span v-else-if="DataModel.ReportStatus==1" class="NoReport">未填写</span>
                                    <span v-else-if="DataModel.ReportStatus==2" class="AlreadyReport">已填写</span>
                                    <span v-else-if="DataModel.ReportStatus==3" class="UpReport">已上报</span>
                                    <span v-else-if="DataModel.ReportStatus==4" class="Success">审核通过</span>   
                                    <span v-else class="NoReport">无需填报</span>                
                                </label>
                            </caption>
                            <thead>
                                <tr><td colspan="4" class="tdLeft">县(市、区)：         填报机关名称：  </td></tr>
                                <tr>
                                    <td width="55%"></td>
                                    <td width="15%">汇总代码</td>
                                    <td width="15%">单位</td>
                                    <td width="15%">数量</td>
                                </tr>
                                <tr><td>甲</td><td>乙</td><td>丙</td><td>1</td></tr>
                            </thead>
                            <tr  class="disableTd">
                                <td class="tdLeft">一、蔬菜市场个数</td>
                                <td>01</td>
                                <td>个</td>
                                <td class="disableTd">
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldPFSC_Num"> -->
                                        <Form-item prop="PFSC_Num">
                                            <Input v-model="DataModel.PFSC_Num"  ></Input>
                                        </Form-item>
                                    <!--  </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <!-- <td>龙头企业总数</td> -->
                                <td class="tdLeftOne">其中：产地批发市场</td>
                                <td>02</td>
                                <td>个</td>
                                <td class="disableTd">
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldPFSC_Cd"> -->
                                        <Form-item prop="PFSC_Cd">
                                            <Input v-model="DataModel.PFSC_Cd" ></Input>
                                        </Form-item>
                                    <!--  </Poptip> --> 
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftTwo">专业批发市场</td>
                                <td>03</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldPFSC_Zy"> -->
                                        <Form-item prop="PFSC_Zy">
                                            <Input v-model="DataModel.PFSC_Zy"></Input>
                                        </Form-item>
                                    <!--  </Poptip> --> 
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftTwo">区域性综合批发市场</td>
                                <td>04</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldPFSC_Qy"> -->
                                        <Form-item prop="PFSC_Qy">
                                            <Input v-model="DataModel.PFSC_Qy"></Input>
                                        </Form-item>
                                    <!--  </Poptip> -->
                                </td>
                            </tr>
                            <tr  class="disableTd">
                                <td class="tdLeft">二、蔬菜企业个数</td>
                                <td>05</td>
                                <td>个</td>
                                <td class="disableTd">
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldVegCompanyNum"> -->
                                        <Form-item prop="VegCompanyNum">
                                            <Input v-model="DataModel.VegCompanyNum"  ></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">其中：国家级龙头企业</td>
                                <td>06</td>
                                <td>个</td>
                                <td class="disableTd">
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_Country"> -->
                                        <Form-item prop="ZzNum_Country">
                                            <Input v-model="DataModel.ZzNum_Country"  ></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftTwo">省级龙头企业</td>
                                <td>07</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_Pro"> -->
                                        <Form-item prop="ZzNum_Pro">
                                            <Input v-model="DataModel.ZzNum_Pro"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftTwo">州(市)级龙头企业</td>
                                <td>08</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_City"> -->
                                        <Form-item prop="ZzNum_City">
                                            <Input v-model="DataModel.ZzNum_City"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftTwo">县(市,区)级龙头企业</td>
                                <td>09</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_Area"> -->
                                        <Form-item prop="ZzNum_Area">
                                            <Input v-model="DataModel.ZzNum_Area"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftTwo">其他龙头企业</td>
                                <td>10</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_Other"> -->
                                        <Form-item prop="ZzNum_Other">
                                            <Input v-model="DataModel.ZzNum_Other"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr  class="disableTd">
                                <td  class="tdLeft">三、蔬菜农民合作社</td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td  class="tdLeftOne">1.蔬菜专业合作组织数量</td>
                                <td>11</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldVegHzNum"> -->
                                        <Form-item prop="VegHzNum">
                                            <Input v-model="DataModel.VegHzNum" ></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">2.参加蔬菜农民合作社农户数</td>
                                <td>12</td>
                                <td>户</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldVegNhNum"> -->
                                        <Form-item prop="VegNhNum">
                                            <Input v-model="DataModel.VegNhNum"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">3.蔬菜农民合作社经营面积</td>
                                <td>13</td>
                                <td>亩</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldVegMjNum"> -->
                                        <Form-item prop="VegMjNum">
                                            <Input v-model="DataModel.VegMjNum"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">4.蔬菜农民合作社年销售收入</td>
                                <td>14</td>
                                <td>万元</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldVegMjNum"> -->
                                        <Form-item prop="VegHzSale">
                                            <Input v-model="DataModel.VegHzSale"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr  class="disableTd">
                                <td class="tdLeft">四、蔬菜家庭农场</td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">1.蔬菜家庭农场数量</td>
                                <td>15</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldJTNC_Num"> -->
                                        <Form-item prop="JTNC_Num">
                                            <Input v-model="DataModel.JTNC_Num" ></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td  class="tdLeftOne">2.参加蔬菜家庭农场农户数</td>
                                <td>16</td>
                                <td>户</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldJTNC_NMNum"> -->
                                        <Form-item prop="JTNC_NMNum">
                                            <Input v-model="DataModel.JTNC_NMNum"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">3.蔬菜家庭农场经营面积(其中:流转土地面积)</td>
                                <td>17</td>
                                <td>亩</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldJTNC_Area"> -->
                                        <Form-item prop="JTNC_Area">
                                            <Input v-model="DataModel.JTNC_Area"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">4.蔬菜家庭农场年销售收入</td>
                                <td>18</td>
                                <td>万元</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldJTNC_Sales"> -->
                                        <Form-item prop="JTNC_Sales">
                                            <Input v-model="DataModel.JTNC_Sales"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr  class="disableTd">
                                <td  class="tdLeft">五、相关质量标准认证情况</td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">(一)国家级农业标准化示范县数量</td>
                                <td>19</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_Sfx"> -->
                                        <Form-item prop="ZlrzNum_Sfx">
                                            <Input v-model="DataModel.ZlrzNum_Sfx" ></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">(二)出口食品农产品质量安全示范区数量</td>
                                <td>20</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_Sfq"> -->
                                        <Form-item prop="ZlrzNum_Sfq">
                                            <Input v-model="DataModel.ZlrzNum_Sfq"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">(三)中国驰名商标数</td>
                                <td>21</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_Cmsbs"> -->
                                        <Form-item prop="ZlrzNum_Cmsbs">
                                            <Input v-model="DataModel.ZlrzNum_Cmsbs"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td  class="tdLeftOne">(四)中国名牌产品数</td>
                                <td>22</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_Mpcp"> -->
                                        <Form-item prop="ZlrzNum_Mpcp">
                                            <Input v-model="DataModel.ZlrzNum_Mpcp"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td  class="tdLeftOne">(五)云南省著名商标数</td>
                                <td>23</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_YnsZmsb"> -->
                                        <Form-item prop="ZlrzNum_YnsZmsb">
                                            <Input v-model="DataModel.ZlrzNum_YnsZmsb"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td  class="tdLeftOne">(六)无公害农产品数量</td>
                                <td>24</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_WghNum"> -->
                                        <Form-item prop="ZlrzNum_WghNum">
                                            <Input v-model="DataModel.ZlrzNum_WghNum"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td  class="tdLeftOne">(七)无公害农产品认证面积</td>
                                <td>25</td>
                                <td>亩</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_Wghmj"> -->
                                        <Form-item prop="ZlrzNum_Wghmj">
                                            <Input v-model="DataModel.ZlrzNum_Wghmj"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td  class="tdLeftOne">(八)绿色产品数</td>
                                <td>26</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_Greencp"> -->
                                        <Form-item prop="ZlrzNum_Greencp">
                                            <Input v-model="DataModel.ZlrzNum_Greencp"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td  class="tdLeftOne">(九)绿色产品认证面积</td>
                                <td>27</td>
                                <td>亩</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_Greencpmj"> -->
                                        <Form-item prop="ZlrzNum_Greencpmj">
                                            <Input v-model="DataModel.ZlrzNum_Greencpmj"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td  class="tdLeftOne">(十)地理标志证明商标数</td>
                                <td>28</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_Dlsb"> -->
                                        <Form-item prop="ZlrzNum_Dlsb">
                                            <Input v-model="DataModel.ZlrzNum_Dlsb"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                            <tr>
                                <td class="tdLeftOne">(十一)地理标志产品保护认证数</td>
                                <td>29</td>
                                <td>个</td>
                                <td>
                                    <!-- <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_Dlbh"> -->
                                        <Form-item prop="ZlrzNum_Dlbh">
                                            <Input v-model="DataModel.ZlrzNum_Dlbh"></Input>
                                        </Form-item>
                                    <!-- </Poptip> -->
                                </td>
                            </tr>
                        </table>
                    </Form>
                    <div class="divButton">
                        <Button type="primary" @click="save('DataModel')" :disabled="DataModel.ReportStatus < 3 && BtnSaveStatus ? false:true">保存</Button>
                        <Button type="primary" @click="DataUp(DataModel.ReportId)" :disabled="DataModel.ReportStatus == 2 ? false:true">上报</Button>
                    </div>
                </div>
                <div class="FIllTip" v-else>温馨提示:本时段不在系统报表填报时间内，请耐心等待。</div>
                <div style="margin-bottom:50px;">
                    <Alert style="margin-top:5px;text-align:left" banner type="error">
                    填报说明: 填报说明:1.全省范围内从乡（镇）推广站起，逐级全面统计，由州（市）汇总后上报。
                    <span slot="desc">
                    </span>
                </Alert>
                </div>
                </Col>
            </Row>
        </div>
    </template>
<script>
export default {
    data() {
        const validateData = (rule, value, callback) => {
            var temp = /^[0-9]\d*(\.\d+)?$/;
            if (value != null && value != "") {
                if (temp.test(value) == false) {
                    callback(new Error('必须是大于0的数字'));
                }
                else {
                    callback();
                }
            } else {
                callback();
            }
        };
        return {
            self: this,
            CreateYearList: this.GetGroupDict("ReportYear"), //填报年度
            CurrentYear: this.GetCurrentYear(),//当前年度
            BtnSaveStatus: false,
             isFull:false,
            //查询模型：根据需求删除不不要查询条件
            //蔬菜生产情况表代码
            searchModel: {
                Id: '',
                ReportCode: 'VegProsecution',
                FillInYear: '',
                TimesType: '',
                AreaCode: this.GetlocaStorage("VegUserInfo").AreaCode,
                PageNumber: 1,
                PageSize: 20,
                Status: '',
                Opinion: ''
            },
            DataModel: {//编辑模型
                Id: 0,
                ReportId: '',
                PFSC_Num: '',
                PFSC_Cd: '',
                PFSC_Zy: '',
                PFSC_Qy: '',
                VegCompanyNum: '',
                ZzNum_Country: '',
                ZzNum_Pro: '',
                ZzNum_City: '',
                ZzNum_Area: ''
                ,ZzNum_Other: ''
                ,VegHzNum: ''
                ,VegNhNum: ''
                ,VegMjNum: ''
                ,VegHzSale:''
                ,JTNC_Num: ''
                ,JTNC_NMNum: ''
                ,JTNC_Area: ''
                ,JTNC_Sales: ''
                ,ZlrzNum_Sfx: ''
                ,ZlrzNum_Sfq: ''
                ,ZlrzNum_Cmsbs: ''
                ,ZlrzNum_Mpcp: ''
                ,ZlrzNum_YnsZmsb: ''
                ,ZlrzNum_WghNum: ''
                ,ZlrzNum_Wghmj: ''
                ,ZlrzNum_Greencp: ''
                ,ZlrzNum_Greencpmj: ''
                ,ZlrzNum_Dlsb: ''
                ,ZlrzNum_Dlbh: ''
                ,Remark: ''
                ,ReportStatus: '',
                //*******上年数据 */
                OldId: 0,
                OldReportId: '',
                OldPFSC_Num: '',
                OldPFSC_Cd: '',
                OldPFSC_Zy: '',
                OldPFSC_Qy: '',
                OldVegCompanyNum: '',
                OldZzNum_Country: '',
                OldZzNum_Pro: '',
                OldZzNum_City: '',
                OldZzNum_Area: ''
                ,OldZzNum_Other: ''
                ,OldVegHzNum: ''
                ,OldVegNhNum: ''
                ,OldVegMjNum: ''
                ,OldJTNC_Num: ''
                ,OldJTNC_NMNum: ''
                ,OldJTNC_Area: ''
                ,OldJTNC_Sales: ''
                ,OldZlrzNum_Sfx: ''
                ,OldZlrzNum_Sfq: ''
                ,OldZlrzNum_Cmsbs: ''
                ,OldZlrzNum_Mpcp: ''
                ,OldZlrzNum_YnsZmsb: ''
                ,OldZlrzNum_WghNum: ''
                ,OldZlrzNum_Wghmj: ''
                ,OldZlrzNum_Greencp: ''
                ,OldZlrzNum_Greencpmj: ''
                ,OldZlrzNum_Dlsb: ''
                ,OldZlrzNum_Dlbh: ''
                ,OldRemark: ''
                ,OldReportStatus: ''
            },
            ruleModel: {
                PFSC_Num: [{ validator: validateData, trigger: 'blur' }],
                PFSC_Cd: [{ validator: validateData, trigger: 'blur' }],
                PFSC_Zy: [{ validator: validateData, trigger: 'blur' }],
                PFSC_Qy: [{ validator: validateData, trigger: 'blur' }],
                VegCompanyNum: [{ validator: validateData, trigger: 'blur' }],
                ZzNum_Country: [{ validator: validateData, trigger: 'blur' }],
                ZzNum_Pro: [{ validator: validateData, trigger: 'blur' }],
                ZzNum_City: [{ validator: validateData, trigger: 'blur' }],
                ZzNum_Area: [{ validator: validateData, trigger: 'blur' }],
                ZzNum_Other: [{ validator: validateData, trigger: 'blur' }],
                VegHzNum: [{ validator: validateData, trigger: 'blur' }],
                VegNhNum: [{ validator: validateData, trigger: 'blur' }],
                VegMjNum: [{ validator: validateData, trigger: 'blur' }],
                JTNC_Num: [{ validator: validateData, trigger: 'blur' }],
                JTNC_NMNum: [{ validator: validateData, trigger: 'blur' }],
                JTNC_Area: [{ validator: validateData, trigger: 'blur' }],
                JTNC_Sales: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_Sfx: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_Sfq: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_Cmsbs: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_Mpcp: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_YnsZmsb: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_WghNum: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_Wghmj: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_Greencp: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_Greencpmj: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_Dlsb: [{ validator: validateData, trigger: 'blur' }],
                ZlrzNum_Dlbh: [{ validator: validateData, trigger: 'blur' }],
            },
            ctx: this, //table数据上下文
            clientHeight: window.innerHeight - 270, //表格默认高度
        }
    },
    computed: {     },
    mounted() {
        window.onresize = () => {
            return (() => {
                this.clientHeight = window.innerHeight - 220;
            })()
        };
    },
    methods: {
        GetData: function () { //初始化当年的数据
            var self = this;
            var model = new Object();
            model.ReportCode = self.searchModel.ReportCode;
            if (self.searchModel.FillInYear != null && self.searchModel.FillInYear != '') {
                model.FillInYear = self.searchModel.FillInYear;
                self.isFull= self.IsFillForTableYear(parseInt(self.searchModel.FillInYear));
            } else {
                self.isFull= self.IsFillForTableYear(self.CurrentYear);
                model.FillInYear = self.CurrentYear + '年';//填报年度-----数据字典值
                self.searchModel.FillInYear = self.CurrentYear + '年';
            }
            model.AreaCode = self.searchModel.AreaCode;
            self.DataModel = {};//清空当前数据   
            model.AreaCode = self.searchModel.AreaCode;
            self.DataModel = {};
            self.$http.post("Report/PostData", model).then( //获取数据编辑项的值
                function (res) {
                    if (res.data.list.status == 2 || res.data.list.status == 1) {
                        self.DataModel = res.data.list.model;
                        self.BtnSaveStatus = true;
                    } else {
                        self.DataModel = res.data.list.model;
                        self.$Modal.warning({
                            title: "提示信息",
                            content: res.data.list.message
                        });
                        self.BtnSaveStatus = false;
                    }
                }
            );
        },
        //保存方法
        save(name) {
            var self = this;
            this.$refs[name].validate((valid) => {
                if (valid) {
                    this.$http.put('VegProsecution', self.DataModel).then(
                        function (res) {
                            if (res.data.status == 1) {
                                self.GetData();
                                self.$Notice.success({
                                    title: '数据保存成功！',
                                    desc: false
                                });
                            } else {
                                self.$Modal.warning({
                                    title: "提示信息",
                                    content: "更新失败,请与管理员联系!"
                                });
                            }
                        }
                    );
                }
                else {
                    this.$Message.error('数据验证失败，请检查后再试!');
                }
            });

        },
        //数据上报
        DataUp: function () {
            var self = this;
            var model = new Object();
            model.Id = self.DataModel.ReportId;
            model.Status = 3;
            model.Opinion = '';
            self.$Modal.confirm({
                title: '提示信息',
                content: '<p>数据上报后，不能再更改，是否继续上报？</p>',
                onOk: () => {
                    self.$http.post('Report/PostUpStatus', model).then(function (res) {
                        if (res.data.status === 1) {
                            self.$Notice.success({
                                title: '数据上报成功',
                                desc: false
                            });
                            self.searchModel.Status = '';
                            self.GetData(); //读取分页数据
                        } else {
                            self.$Notice.success({
                                title: '数据上报失败',
                                desc: res.data.messages
                            });
                        }
                    });
                },
                onCancel: () => { }
            });
        },
        ValidateData(value) {//检查用户输入的值，是否为大于0的数
            if (value != null) {
                var temp = /^[1-9]\d*(\.\d+)?$/;
                if (temp.test(value) == false)
                    this.$Modal.warning({
                        title: "提示信息",
                        content: "输入错误,输入的值必须是大于0的数,请检查后再试!"
                    });
            }
        },
        //模板下载
        TmpDown: function () {
            window.open(this.$http.defaults.baseURL + "Report/GetTemplateData?ReportCode=" + this.searchModel.ReportCode);
        },
        //导出
        ExcelDown: function () {
            var self = this;
            var model = new Object();
            model.ReportCode = self.searchModel.ReportCode;
            if (self.searchModel.FillInYear != null && self.searchModel.FillInYear != '') {
                model.FillInYear = self.searchModel.FillInYear;
            } else {
                model.FillInYear = self.CurrentYear + '年';//填报年度-----数据字典值
                self.searchModel.FillInYear = self.CurrentYear + '年';
            }
            model.AreaCode = self.searchModel.AreaCode;
            window.open(this.$http.defaults.baseURL + "VegProsecution/GetExcelData?ReportCode=" + model.ReportCode + "&&FillInYear=" + model.FillInYear + "&&AreaCode=" + model.AreaCode);
        },
        //导入
        GetPostUrl() {
            var url = this.$http.defaults.baseURL + "Report/PostImportData?ReportCode=" + this.searchModel.ReportCode + "&&AreaCode=" + this.searchModel.AreaCode + "&&FillInYear=" + this.searchModel.FillInYear;
            return url;
        },
        handleSuccess(res, file) {
            var self = this;
            self.GetData();
            self.$Notice.success({
                title: '数据导入成功！',
                desc: false
            });
        },
    },
    //创建Vue页面方法
    created: function () {
        //创业Vue前调用获取this.datas: {},//table数据对象
        this.GetData();
    },
    watch: {
        //需要监听的在此处新增监听对象
    }
}
</script>